//---------------------------------------------------------------------------- // File: C3DTypes.h // Class: C3DTypes v3 // Type: Common 3D Types // Author: Ken Anderson // Date: 1/9/06 // Desc: Contains Common 3d definitions and structures required in the 3d // world to exist. IE: Vertices, lights, fog, etc. // Version: // 1.0[2/24/4] -- Original version. // 2.0[5/10/05]--Vertex_Packet_C was added to allow for an array of vertices over // a link list. // Vertex_Block_B was added to deal with arrays of data. // 3.0[1/9/06] -- Added Index_Block. // Required headers: // 1. Common.h == Contains common definitions & typedefs. //---------------------------------------------------------------------------- #ifndef _C3DTYPES_ #define _C3DTYPES_ #include "Common.h" #include "CiMedia.h" #include "CBank.h" /////////////////////////////////// // ERROR CODES // // COMMON 3D CLASS // /////////////////////////////////// typedef ECTYPE C3DERR; #define C3D_OK EC_OK //Everything is okay //Common function issues. #define C3DERR_OUTOFMEM ECERR_OUTOFMEM //Out of system memory. #define C3DERR_OUTOFVMEM ECERR_OUTOFMEMV //Out of Video memory. #define C3DERR_OUTOFRNG ECERR_OUTOFRNG //The value is out of range. #define C3DERR_INVALID ECERR_INVALID //A parameter was invalid. #define C3DERR_NSOK ECERR_NSOK //The function was successful but was unable to load/set the desired parameters. #define C3DERR_PATHNOTFOUND ECERR_PATHNOTFOUND //The path was not found for the file or object to be loaded. #define C3DERR_NACREATE ECERR_NACREATE //The proper initialize or creation sequence was not performed. #define C3DERR_NULL ECERR_NULL //A null parameter was supplied. #define C3DERR_NA ECERR_NA //System errors #define C3DERR_3DINCORRECT (0x01 + ECERR_BASECOUNT) //Incorrect version of our 3D system. #define C3DERR_OSINCORRECT (0x02 + ECERR_BASECOUNT) //Limited to only DirectX. This error is reported if DirectX is attempted to be accessed on another OS. #define C3DERR_CRSNOTDEFINED (0x03 + ECERR_BASECOUNT) //CRS was not defined, no renderer was selected. //Display errors #define C3DERR_NOADAPTER (0x20 + ECERR_BASECOUNT) //No display adapters were found, now this is a big problem #define C3DERR_NO3DDEVICE (0x21 + ECERR_BASECOUNT) //The 3d device couldn't be created, incorrect parameters to createdevice #define C3DERR_NOMODES (0x22 + ECERR_BASECOUNT) //No modes exist. This isn't good, or possible. #define C3DERR_NONEXISTANT (0x23 + ECERR_BASECOUNT) //The adapter, device, or mode selected doesn't exist. //Device & Mode States #define C3DERR_DEVICELOST (0x30 + ECERR_BASECOUNT) //Device is lost, window is not in focus. #define C3DERR_DEVICENOTRESET (0x31 + ECERR_BASECOUNT) //Device is found, but needs to be reset. #define C3DERR_WINDOWEDNS (0x32 + ECERR_BASECOUNT) //Windowed mode is not supported. #define C3DERR_MODENS (0x33 + ECERR_BASECOUNT) //Desired Mode is not supported. #define C3DERR_STATENA (0x34 + ECERR_BASECOUNT) //The state or feature was not available on this renderer. //Bank & Pipeline States #define C3DERR_NOINITBANK (0x40 + ECERR_BASECOUNT) //The appropriate render bank was not initialized or created. #define C3DERR_NOINITPIPE (0x41 + ECERR_BASECOUNT) //The pipeline was not initalized. #define C3DERR_PIPENLP (0x42 + ECERR_BASECOUNT) //Null location pointer. #define C3DERR_PIPEEMPTY (0x43 + ECERR_BASECOUNT) //Pipeline is empty. #define C3DERR_PIPENOINDEX (0x44 + ECERR_BASECOUNT) //No index found. #define C3DERR_RBENULL (0x45 + ECERR_BASECOUNT) //The render bank element is null #define C3DERR_UNKNOWN ECERR_UNKNOWN //An unknown error has occured. //////////////////////////////////// // USAGE_FLAGS // //////////////////////////////////// #define UG_XYZ 0x0001 //Vertices are NOT transformed. #define UG_XYZRHW 0x0002 //Vertices are transformed. #define UG_NORMAL 0x0004 //Lightning normals. #define UG_DIFFUSE 0x0008 //Diffuse color. #define UG_SPECULAR 0x0010 //Specular used. #define UG_TEX0 0x0100 //0 Textures #define UG_TEX1 0x0200 //1 Textures #define UG_TEX2 0x0300 //2 Textures #define UG_TEX3 0x0400 //3 Textures #define UG_TEX4 0x0500 //4 Textures #define UG_TEX5 0x0600 //5 Textures #define UG_TEX6 0x0700 //6 Textures #define UG_TEX7 0x0800 //7 Textures #define UG_TEX8 0x0900 //8 Textures //Clear Texture, check textures, settexture bits, set textures. #define UG_CLEARTEX(value) value = ((((value >> 8) & 0x0F) << 8) ^ value) #define UG_SETTEXBIT(value,set) value = (value | ((Word)set << 8)) #define UG_SETTEX(v,s) if(((v >> 8) & 0x0F) < s) {UG_CLEARTEX(v); UG_SETTEXBIT(v,s);} #define UG_GETTEX(v) (v >> 8) //Check Values #define UG_CHKRHW(v) (v & UG_XYZRHW) #define UG_CHKXYZ(v) (!UG_CHKRHW(v)) #define UG_CHKTEX(v) (v & 0x0F00) ///////////////////////////////////////////////////////////////////////// // DEFINITIONS // ///////////////////////////////////////////////////////////////////////// #define MAXTEXTURES 5 typedef struct VERTEX_PACKET_C SC3DVertex; typedef struct VERTEX_PACKET_C* PSC3DVertex; typedef struct VERTEX_PACKET_C** HSC3DVertex; typedef struct VERTEX_BLOCK_B SC3DVertices; typedef struct VERTEX_BLOCK_B* PSC3DVertices; typedef struct VERTEX_BLOCK_B** HSC3DVertices; typedef struct INDEX_BLOCK SC3DIndices; typedef struct INDEX_BLOCK* PSC3DIndices; typedef struct INDEX_BLOCK** HSC3DIndices; ///////////////////////////////////////////////////////////////////////// // ENUMERATIONS // ///////////////////////////////////////////////////////////////////////// //Common 3D Format types. typedef enum _COMMON_3D_FORMAT_TYPES { C3DFMT_16BIT_R5G5B5X1, //16-Bit, 5 bits per color with 1 extra. C3DFMT_16BIT_R5G6B5, //16-Bit, 5 bits for red & green, and 6 bits for blue. C3DFMT_32BIT_X8R8G8B8, //32-Bit, 8 bits per color with 8 extra bits. C3DFMT_32BIT_A8R8G8B8, //32-Bit, 8 bits per color with 8 bits for alpha. } C3DFORMAT; typedef enum _COMMON_3D_DEVICE_TYPES { C3DDEV_HARDWARE, //Rendering is done on the hardware or shared with the software. For DirectX(HAL). C3DDEV_SOFTWARE, //All rendering is done with the software. For DirectX(REF). C3DDEV_PLUGIN, //Plug-in code that renders outside of the software. Maybe only DirectX specific(SW); } C3DDEVTYPE; typedef enum LIGHT_TYPES { C3D_DIRECTIONAL, C3D_POINT, C3D_SPOTLIGHT, } C3DLIGHTTYPE; //Render states used. typedef enum RENDER_STATES { //The following render states are supported by both renders. //Zbuffering C3DRS_ZENABLE, //Allow z-buffering C3DRS_ZBUFFERWRITE, //Allows applications discard or write to zbuffer. C3DRS_ZFUNC, //Method used to compare pixels for z-buffering. C3DRS_ZBIAS, //Ordering method in which polygons are rendered in the z-buffer. //Plane rendering. C3DRS_FILLMODE, //How 3d objects and planes are rendered. C3DRS_SHADEMODE, //How 3d objects are shaded by lighting. C3DRS_LINEPATTERN, //Directs the CRS how to draw a line pattern. //Polygon rendering. C3DRS_LASTPIXEL, //Renders the last pixel. C3DRS_CULLMODE, //Method in which planes/primitives are constructed. C3DRS_CLIPPING, //Enables or disables clipping. C3DRS_CLIPPLANE, //Enables or disables custom user plane cliping. C3DRS_EDGEANTIALIAS, //Anti-aliases the edges of polygons. C3DRS_DITHERENABLE, //Enables or disables dithering. //Alpha blending. C3DRS_ALPHABLENDENABLE, //Allows or disables Alpha blending. C3DRS_ALPHATEST, //Test a color to preform alpha blending. C3DRS_ALPHAREF, //Dword reference alpha value used to test against. C3DRS_ALPHAFUNC, //Method used to compare pixel for alpha blending. C3DRS_BLENDSRC, //Method for blending source color. C3DRS_BLENDDEST, //Method for blending destination color. C3DRS_BLENDOP, //Operationg used for blending. //Textures. C3DRS_TEXTUREFACTOR, C3DRS_WRAP0, C3DRS_WRAP1, C3DRS_WRAP2, C3DRS_WRAP3, C3DRS_WRAP4, C3DRS_WRAP5, C3DRS_WRAP6, C3DRS_WRAP7, //Lighting. C3DRS_LIGHTING, //Enables or disables lighting. C3DRS_NORMALIZENORMALS, //Normalizes all normals automatically. C3DRS_COLORVERTEX, //Enables or disables blending of vertex colors and lighting. C3DRS_AMBIENT, //Value of the ambient light used. C3DRS_SPECULARENABLE, //Enables or disables specular lighting. C3DRS_LOCALVIEWER, //Enables perspective specular(TRUE) or orthogonal specular(FALSE). //Materials. C3DRS_DIFFUSEMATERIALSOURCE, //Method of blending the source of diffuse properties of materials. C3DRS_SPECULARMATERIALSOURCE, //Method of blending the source of specular properties of materials. C3DRS_AMBIENTMATERIALSOURCE, //Method of blending the source of ambient properties of materials. C3DRS_EMISSIVEMATERIALSOURCE, //Method of blending the source of emissive properties of materials. //Fog. C3DRS_FOGENABLE, //Enables or disables fog effects. C3DRS_FOGCOLOR, //Color of the fog. C3DRS_FOGTABLEMODE, //Method of calculating pixel based fog. C3DRS_FOGVERTEXMODE, //Method of calculating vertex based fog. C3DRS_FOGSTART, //Beginning depth value for linear fog, pixel or vertex based. C3DRS_FOGEND, //Ending depth value for linear fog, pixel or vertex based. C3DRS_FOGDENSITY, //Density of fog used in exponential fog, pixel or vertex based. C3DRS_RANGEFOGENABLE, //Enables or disables the range based fog. //Stencil. C3DRS_STENCILENABLE, //Enables or disables the use of stencils. C3DRS_STENCILFAIL, //Operation to perform if a stencil test fails. C3DRS_STENCILZFAIL, //Operation to perform if the stencil test passes but the depth testing fails. C3DRS_STENCILPASS, //Operating to perform if stencil and depth testing pass. C3DRS_STENCILFUNC, //Method use to compare stencils during their tests. C3DRS_STENCILREF, //Integer value to compare stencils too. C3DRS_STENCILMASK, //Mask applied to reference value & stencil under test. C3DRS_STENCILWRITEMASK, //Write stencil mask. //Point Sprites. C3DRS_MAXPOINTSIZE, //Maximum size of point sprites. C3DRS_MINPOINTSIZE, //Minimum size of point sprites. C3DRS_POINTSPRITE, //Enables or disables point sprites. C3DRS_POINTSCALE, //Enables or disables point scaling. C3DRS_POINTSIZE, //Size of the point sprite. C3DRS_POINTSCALE_A, //Attenuation of scale. C3DRS_POINTSCALE_B, C3DRS_POINTSCALE_C, C3DRS_SOFTWAREVERTEXPROCESSING, //Allows software vertex processing unless HARDWARE T&L. //The following render states are supported by OpenGL only. //The following render states are supported by Direct3D only. C3DRS_VERTEXBLEND, //Number of matrices to use in vertex blending. } C3DRenderState; //Blending Operations typedef enum BLEND_OPERATIONS { C3DBLEND_ZERO, C3DBLEND_ONE, C3DBLEND_SRCCOLOR, C3DBLEND_INVSRCCOLOR, C3DBLEND_SRCALPHA, C3DBLEND_INVSRCALPHA, C3DBLEND_DESTALPHA, C3DBLEND_INVDESTALPHA, C3DBLEND_DESTCOLOR, C3DBLEND_INVDESTCOLOR, C3DBLEND_SRCALPHASAT, C3DBLEND_BOTHINVSRCALPHA, } C3DBlend; //Compare operations typedef enum CMP_OPERATIONS { C3DCMP_NEVER, C3DCMP_LESS, C3DCMP_EQUAL, C3DCMP_LESSEQUAL, C3DCMP_GREATER, C3DCMP_NOTEQUAL, C3DCMP_GREATEREQUAL, C3DCMP_ALWAYS, } C3DCmpOp; //Culling operations. typedef enum CULL_OPERATIONS { C3DCULL_NONE, C3DCULL_CW, C3DCULL_CCW, } C3DCull; //Texture Stage States typedef enum TEXTURE_STAGE_STATES { C3DTSS_COLOROP, //Color blending C3DTSS_COLORARG1, //Color argument 1 C3DTSS_COLORARG2, //Color argument 2 C3DTSS_ALPHAOP, //Alpha blending for transparency effects. C3DTSS_ALPHAARG1, //Alpha Argument 1 C3DTSS_ALPHAARG2, //Alpha Argument 2 C3DTSS_BUMPENVMAT00, //Bump Map Coefficient 00 C3DTSS_BUMPENVMAT01, //Bump Map Coefficient 01 C3DTSS_BUMPENVMAT10, //Bump Map Coefficient 10 C3DTSS_BUMPENVMAT11, //Bump Map Coefficient 11 C3DTSS_TEXCOORDINDEX, //Allows the use of a matrix that can be used to define the textures around objects. C3DTSS_ADDRESSU, //Defines how the texture will wrap along the u-axis. C3DTSS_ADDRESSV, //Defines how the texture will wrap along the v-axis. C3DTSS_BORDERCOLOR, //Defines how the border or the coordinates beyond the texture is colored. C3DTSS_MAGFILTER, //Defines the texture filter for magnification. C3DTSS_MINFILTER, //Defines the texture filter for minification. C3DTSS_MIPFILTER, //Defines the texture filter for mip mapping. C3DTSS_MIPMAPLODBIAS, //Adjusts the bias of the mip map levels. C3DTSS_MAXMIPLEVEL, //Limits the maximum level of mip maps that can be used. C3DTSS_MAXANISOTROPHY, //Max level of Anisotrophy. C3DTSS_BUMPENVLSCALE, //Scale value of Bump luminance. C3DTSS_BUMPENVLOFFSET, //Offset value of Bump luminance. C3DTSS_TEXTURETRANSFORMFLAGS, //Defines how the transformation of textures if performed. C3DTSS_ADDRESSW, //Defines how the texture will wrap along the w-axis. C3DTSS_COLORARG0, //3rd value used in multiply add or linear interpoling for color operations. C3DTSS_ALPHAARG0, //3rd value used in mulitply add or linear interpoling for alpha operations. } C3DTextureStageState; //Texture Operations that define how the textures, //color values, and transparencies blend. typedef enum TEXTURE_OPERATIONS { C3DTOP_DISABLE, //Disables the textures state. C3DTOP_SELECTARG1, //Selects argument 1. C3DTOP_SELECTARG2, //Selects argument 2. C3DTOP_MODULATE, //Modulates or Mulitplies the two arguments. C3DTOP_MODULATE2X, //Modulates or Multiplies the arguments then multiplies the value by 2. C3DTOP_MODULATE4X, //Modulates or Multiplies the arguments then multiplies the value by 4. C3DTOP_ADD, //Adds two arguments together. C3DTOP_ADDSIGNED, //Adds two arguments together with a + or - 0.5 bias range. C3DTOP_ADDSIGNED2X, //Adds two arguments together with a + or - 0.5 bias multiplied by 2. C3DTOP_SUBTRACT, //Subtracts two arguments from each other. C3DTOP_ADDSMOOTH, //Adds the two arguments together then subtracts their product from the sum. C3DTOP_BLENDDIFFUSEALPHA, //Blends the color with the alpha. C3DTOP_BLENDTEXTUREALPHA, //Blends the texture value with the alpha. C3DTOP_BLENDFACTORALPHA, //Blends the factor by the alpha value. C3DTOP_BLENDTEXTUREALPHAPM, //Blends a texture with a premultiplied alpha. C3DTOP_BLENDCURRENTALPHA, //Blends the current value with the alpha. C3DTOP_PREMODULATE, //Modulates current texture with the next. C3DTOP_MODULATEALPHA_ADDCOLOR, //Modulates the second argument with the alpha value then adds it to the first argument. C3DTOP_MODULATECOLOR_ADDALPHA, //Modulates the arguments then adds the alpha value. C3DTOP_MODULATEINVALPHA_ADDCOLOR, //Modulates the second argument with the inversed alpha value then adds it to the first argument. C3DTOP_MODULATEINVCOLOR_ADDALPHA, //Modulates the arguments then adds the inverse of the alpha value. C3DTOP_BUMPENVMAP, //Performs Environmental Bump Mapping without luminance. C3DTOP_BUMPENVMAPLUMINANCE, //Performs Environmental Bump Mapping with Luminance. C3DTOP_DOTPRODUCT3, //Modulates the individual color intensities of each argument and adds them together. C3DTOP_MULTIPLYADD, //Multiplies the first 2 arguments then adds to the first one. C3DTOP_LERP, //Lineraly interpolates. } C3DTextureOP; //Texture Filtering will determine how pixelated or smooth the textures will appear. typedef enum TEXTURE_FILTER_TYPE { C3DTFT_NONE, //No filtering. C3DTFT_POINT, //Pixels in the texture are resized on pixel by pixel basis. C3DTFT_LINEAR, //Pixles are Bilinear interpols as the texture is resized. C3DTFT_ANISOTROPIC, //Anisotropic filtering of texture. C3DTFT_FLATCUBIC, //Flat-cubic filtering. C3DTFT_GAUSSIANCUBIC, //Gaussian-cubic filtering. } C3DTextureFilterType; //Texture Arguments dictates how the arguements are going to function. typedef enum TEXTURE_ARGUEMENT_TYPE { C3DTA_CURRENT, //The current color is used from previous operations. C3DTA_DIFFUSE, //The diffuse color is used. C3DTA_SELECTMASK, //A mask is applied to the color map. C3DTA_SPECULAR, //The specular color is used. C3DTA_TEMP, //Temporary register. C3DTA_TEXTURE, //The texture of the color is used. C3DTA_TFACTOR, //Set with the Texture Factor value of the render state operation. C3DTA_ALPHAREPLICATE, //Replicates the current alpha value. C3DTA_COMPLEMENT, //Inverts the alpha color map. } C3DTextureArgumentType; //Texture Address dictates how the texture will be wrapped around an object. typedef enum TEXTURE_ADDRESS_TYPE { C3DTAT_WRAP, //Textures are tiled at every integer boundry. C3DTAT_MIRROR, //Mirrors the texture at every integer boundry. C3DTAT_CLAMP, //Coordinates outside of the 1.0 boundry are set to the texture color. C3DTAT_BORDER, //Coordinates outside of the 1.0 boundry are set to the border color. C3DTAT_MIRRORONCE, //Mirrors once and then clamps the coordinates. } C3DTextureAddressType; //The method in which vertices are linked and drawn. typedef enum PRIMITIVE_TYPE { C3DPT_UNKNOWN, //Type is unknown. C3DPT_POINTLIST, //Draws a list of vertices as individual points. C3DPT_LINELIST, //Draws a list of vertices connected by two points. C3DPT_LINESTRIP, //Draws a list of vertices in a continous strip. C3DPT_TRIANGLELIST, //Draws a list of vertices connected by three points. C3DPT_TRIANGLESTRIP, //Draws a list of vertices in a continous strip C3DPT_TRIANGLEFAN, //Draws a list of vertices connected to a single point like a fan. } C3DPrimitiveType; //Transform states typedef enum TRANSFORM_STATE { C3DTS_WORLD, C3DTS_VIEW, C3DTS_PROJECTION, C3DTS_TEXTURE0, C3DTS_TEXTURE1, C3DTS_TEXTURE2, C3DTS_TEXTURE3, C3DTS_TEXTURE4, C3DTS_TEXTURE5, C3DTS_TEXTURE6, C3DTS_TEXTURE7, } C3DTransformState; //Transform states typedef enum TRANSFORM_TYPE { C3DTS_ROTATE, C3DTS_SCALE, C3DTS_TRANSLATE, } C3DTransformType; //Fill modes. typedef enum FILLMODE_TYPE { C3DFILL_POINT, C3DFILL_WIRE, C3DFILL_SOLID, C3DFILL_NOTEXTURE, } C3DFillMode; ///////////////////////////////////////////////////////////////////////// // COMMON 3D STRUCTURES // ///////////////////////////////////////////////////////////////////////// //Vertices typedef struct UNTRANSFORMED_2POINT_VERTEX { float x,y; } SC3DVertex2f; typedef struct UNTRANSFORMED_3POINT_VERTEX { float x,y,z; } SC3DVertex3f; typedef struct UNTRANSFORMED_4POINT_VERTEX { float x,y,z,rhw; } SC3DVertex4f; typedef struct RGB_COLOR_FILTER { float r, g, b, a; } SC3DColor4f; ///////////////////////////////////////////////////////////////////////// // MATRICIES // ///////////////////////////////////////////////////////////////////////// typedef struct MATRIX_DIMENSION_3X3 { union{ struct { float _11, _12, _13; float _21, _22, _23; float _31, _32, _33; }; float fElement[3][3]; }; } SC3DMatrix3, SC3DMatricies3, C3DMatrix3; typedef struct MATRIX_DIMENSION_4X4 { union{ struct{ float _11, _12, _13, _14; float _21, _22, _23, _24; float _31, _32, _33, _34; float _41, _42, _43, _44; }; float fElement[4][4]; }; } SC3DMatrix4, SC3DMatricies4, *PSC3DMatrix4, C3DMatrix4; typedef C3DMatrix4 C3DMatrix; ///////////////////////////////////////////////////////////////////////// // PACKETS // ///////////////////////////////////////////////////////////////////////// struct VERTEX_PACKET_A { union { SC3DVertex4f v4; //UNION: Vertex position(transformed) SC3DVertex3f v3; //UNION: Vertex position(nontransformed) }; SC3DVertex3f n; //Normal position. SC3DVertex2f t[MAXTEXTURES]; //Array of texture coordinates. Dword dwDiffuse; //Diffuse of vertex. Dword dwSpecular; //Specular transformed lighting of vertex. VERTEX_PACKET_A* Next; //Next Vertex in the packet. VERTEX_PACKET_A* Prev; //Previous Vertex in the packet. }; struct VERTEX_PACKET_B { SC3DVertex4f* v; //Vertex position. SC3DVertex3f* n; //Normal position. SC3DVertex2f* t[MAXTEXTURES]; //Array of texture coordinates. Dword* dwDiffuse; //Diffuse of vertex. Dword* dwSpecular; //Specular transformed lighting of vertex. Dword dwNumVerts; //Number of vertices & their corresponding normals, texture coords //color and specular lighting. }; //Implemented in version 2: 5/10/05 struct VERTEX_PACKET_C { union { SC3DVertex4f v4; //UNION: Vertex position(transformed) SC3DVertex3f v3; //UNION: Vertex position(nontransformed) }; SC3DVertex3f n; //Normal position. SC3DVertex2f t[MAXTEXTURES]; //Array of texture coordinates. Dword dwDiffuse; //Diffuse of vertex. Dword dwSpecular; //Specular transformed lighting of vertex. }; typedef struct LIGHT_PACKET { C3DLIGHTTYPE type; Bool bEnabled; SC3DColor4f dwDiffuse; SC3DColor4f dwSpecular; SC3DVertex3f v4Position; SC3DVertex3f v4Direction; float fRange; float fFalloff; float fAttenuation[3]; float fTheta; float fPhi; LIGHT_PACKET* Next; LIGHT_PACKET* Prev; } SC3DLight, SC3DLights, SC3DPhoton, SC3DPhotons; typedef struct MATERIAL_PACKET { SC3DColor4f fDiffuse, fAmbient, fSpecular, fEmissive; float fPower; } SC3DMaterial; //Texture Stage State typedef struct TSS_PACKET { Byte byStage; C3DTextureStageState tss; Dword dwValue; } SC3DTSS, *PSC3DTSS, **HSC3DTSS; typedef struct MATRIX_TRANSFORM_PACKET { SC3DVertex3f daxis; //The three degrees of change in the 3 axes SC3DVertex3f frate; //Rate of change of the axes C3DTransformType tt; //Transform type of matrix. } MTP, *PMTP, **HMTP; typedef struct RENDER_STATE_PACKET { C3DRenderState rs; Dword dwValue; } SC3DRS, *PSC3DRS, **HSC3DRS; typedef struct TEXTURE_PACKET { CiMedia* pMedia; //Media Object. string sTexture; //Name of the texture. Byte byStage; //Stage of the vertex. } SC3DTextures, *PSC3DTextures; typedef struct VIEWPORT_PACKET { Dword dwX; Dword dwY; Dword dwHeight; Dword dwWidth; float fMinZ; float fMaxZ; } SC3DViewport, *PSC3DViewport; typedef struct CAPABILITIES_PACKET { Byte byDevType; Dword AdapterOrdinal; Dword Caps; Dword Caps2; Dword Caps3; Dword PresentationIntervals; Dword CursorCaps; Dword DevCaps; Dword PrimitiveMiscCaps; Dword RasterCaps; Dword ZCmpCaps; Dword SrcBlendCaps; Dword DestBlendCaps; Dword AlphaCmpCaps; Dword ShadeCaps; Dword TextureCaps; Dword TextureFilterCaps; Dword CubeTextureFilterCaps; Dword VolumeTextureFilterCaps; Dword TextureAddressCaps; Dword VolumeTextureAddressCaps; Dword LineCaps; Dword MaxTextureWidth; Dword MaxTextureHeight; Dword MaxVolumeExtend; Dword MaxTextureRepeat; Dword MaxTextureAspectRatio; Dword MaxAnisotropy; float MaxVertexW; float GuardBandLeft; float GuardBandTop; float GuardBandRight; float GuardBandBottom; float ExtentsAdjust; Dword StencilCaps; Dword FVFCaps; Dword TextureOpCaps; Dword MaxTextureBlendStages; Dword MaxSimultaneousTextures; Dword VertexProcessingCaps; Dword MaxActiveLights; Dword MaxUserClipPlanes; Dword MaxVertexBlendMatrices; Dword MaxVertexBlendMatrixIndex; float MaxPointSize; Dword MaxPrimitiveCount; Dword MaxVertexIndex; Dword MaxStreams; Dword MaxStreamStride; Dword VertexShaderVersion; Dword MaxVertexShaderConst; Dword PixelShaderVersion; float MaxPixelShaderValue; } C3DCAPS, *PC3DCAPS; ///////////////////////////////////////////////////////////////////////// // BLOCKS // ///////////////////////////////////////////////////////////////////////// struct VERTEX_BLOCK_A { PSC3DVertex pVHead; //Head of the vertex pipeline. Dword dwVertnum; //Number of vertices in the pipeline. Word wUsage; //Values being used. Direct3d specific. PSC3DVertex pVTail; //Tail of vertex pipeline. //Render information. bool bEnabled; //Enables or disables rendering. Byte byStage; //Stage of the vertex. C3DPrimitiveType pt; //Method of rendering vertex block. Dword dwStartRend; //Starting position of the vertex to render. Dword dwNumRend; //Number of vertices to render. }; //Version 2 methodology: 5/10/05 struct VERTEX_BLOCK_B { PSC3DVertex pVArray; //Head of vertices. Dword dwVertnum; //Number of vertices in the pipeline. Word wUsage; //Values being used. Direct3d specific. //Render information. bool bEnabled; //Enables or disables rendering. Byte byStage; //Stage of the vertex. C3DPrimitiveType pt; //Method of rendering vertex block. Dword dwStartRend; //Starting position of the vertex to render. Dword dwNumRend; //Number of vertices to render. }; //Added 1/9/06 struct INDEX_BLOCK { Dword* pdwIdxTable; //Index table/Array of Indicies Dword dwIdxnum; //Number of indicies in the table.. }; #endif